/*
 * LabelDelegate.h  0.4.0 / Nov 17, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef LABELDELEGATE_H
#define LABELDELEGATE_H

#include "Cute4jSwing.h"

#include "ComponentDelegate.h"
#include "QLabelAdapter.h"

// LabelDelegate Class. --------------------------------------------------------

/*!
 * \brief Label Delegate.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT LabelDelegate : public ComponentDelegate
{
  Q_OBJECT
protected:
  LabelDelegate(JNIEnv *env, jobject obj);
public slots: // native calls
  void setText(JNIEnv *env, jstring text);
  void setTextFormat(JNIEnv *env, jint textFormat);
  void setWordWrap(JNIEnv *env, jboolean wordWrap);
  void setAlignment(JNIEnv *env, jint ha, jint va);
  void setIcon(JNIEnv *env, jobject iconSet);
  void setIconSize(JNIEnv *env, jint width, jint height);
  void setBorderType(JNIEnv *env, jint borderType);
  void setBorderStyle(JNIEnv *env, jint borderStyle);
  void setBorderWidth(JNIEnv *env, jint borderWidth);
public: // native calls
  static void initialize(JNIEnv *env, jclass cls);
  static jlong newInstance(JNIEnv *env, jobject obj);
public:
  inline QLabelAdapter *qLabelAdapter() const;
};

// LabelDelegate :: Inline Member Function. ------------------------------------

/*!
 * \brief Returns QLabel adaptee.
 *
 * \return QLabel adaptee
 */
inline QLabelAdapter *LabelDelegate::qLabelAdapter() const
{
  return static_cast<QLabelAdapter *>(qObject());
}

// Macro Definitions. ----------------------------------------------------------

#define LABEL_DELEGATE (reinterpret_cast<LabelDelegate *>(delegate))

#endif // LABELDELEGATE_H
